package tcp

import (
	"log"
)

// ========================================
// TCP协议工厂
// 实现 protocols.ProtocolFactory 接口
// ========================================

// Factory TCP协议处理器工厂
type Factory struct{}

// CreateHandler 创建TCP协议处理器
func (f *Factory) CreateHandler(tunnelID, targetHost, targetPort string) (*Handler, error) {
	log.Printf("🏭 [TCP工厂] 创建TCP处理器: target=%s:%s", targetHost, targetPort)
	return NewHandler(tunnelID, targetHost, targetPort), nil
}

// SupportedProtocol 返回支持的协议类型
func (f *Factory) SupportedProtocol() uint8 {
	return 2 // ProtocolTCP
}

// NewFactory 创建TCP工厂实例
func NewFactory() *Factory {
	return &Factory{}
}
